using System;
using System.Data;
using System.Collections.Generic;
using Soccer.Core;
using Soccer.Utility;

namespace Soccer.Business
{
    [TableAttribute("UnderOverOdds")]
	[Serializable]
    public class UnderOverOdd : DBO<UnderOverOdd>
    {
		#region Fields
		
		private int? _IdUnderOverOdd;
		private int? _IdMatch;
		private string _Total;
		private double? _Under;
		private double? _Over;
		private string _OddsType;
		
		#endregion
		
		#region Constructors
		/// <summary>
		/// Default constructor
		/// </summary>
		public UnderOverOdd()
		{
			
		}
		
		/// <summary>
		/// Constructor with IdUnderOverOdd 
		/// </summary>
		/// <param name="IdUnderOverOdd">The IdUnderOverOdd</param>
		public UnderOverOdd(int? IdUnderOverOdd )
		{
			this.IdUnderOverOdd = IdUnderOverOdd;
		}
		
		/// <summary>
		/// Constructor with all parameters
		/// </summary>
		/// <param name="IdUnderOverOdd">Sets int? value for IdUnderOverOdd</param>
		/// <param name="IdMatch">Sets int? value for IdMatch</param>
		/// <param name="Total">Sets string value for Total</param>
		/// <param name="Under">Sets double? value for Under</param>
		/// <param name="Over">Sets double? value for Over</param>
		/// <param name="OddsType">Sets string value for OddsType</param>
		public UnderOverOdd(int? idUnderOverOdd, int? idMatch, string total, double? under, double? over, string oddsType)
		{
			this.IdUnderOverOdd = idUnderOverOdd;
			this.IdMatch = idMatch;
			this.Total = total;
			this.Under = under;
			this.Over = over;
			this.OddsType = oddsType;
		}
		
		#endregion
		
		#region Properties
		
		/// <summary>
		/// Gets or sets int? value for IdUnderOverOdd
		/// </summary>
		[ColumnAttribute("IdUnderOverOdd", SqlDbType.Int , 4 , true, true, false)]
		public int? IdUnderOverOdd
		{
			set
			{
				this._IdUnderOverOdd = value;
			}
			get
			{
				return this._IdUnderOverOdd;
			}
		}
		
		/// <summary>
		/// Gets or sets int? value for IdMatch
		/// </summary>
		[ColumnAttribute("IdMatch", SqlDbType.Int , 4 , false, false, true)]
		public int? IdMatch
		{
			set
			{
				this._IdMatch = value;
			}
			get
			{
				return this._IdMatch;
			}
		}
		
		/// <summary>
		/// Gets or sets string value for Total
		/// </summary>
		[ColumnAttribute("Total", SqlDbType.NVarChar , 10 , false, false, true)]
		public string Total
		{
			set
			{
				this._Total = value;
			}
			get
			{
				return this._Total;
			}
		}
		
		/// <summary>
		/// Gets or sets double? value for Under
		/// </summary>
		[ColumnAttribute("Under", SqlDbType.Float , 8 , false, false, true)]
		public double? Under
		{
			set
			{
				this._Under = value;
			}
			get
			{
				return this._Under;
			}
		}
		
		/// <summary>
		/// Gets or sets double? value for Over
		/// </summary>
		[ColumnAttribute("Over", SqlDbType.Float , 8 , false, false, true)]
		public double? Over
		{
			set
			{
				this._Over = value;
			}
			get
			{
				return this._Over;
			}
		}
		
		/// <summary>
		/// Gets or sets string value for OddsType
		/// </summary>
		[ColumnAttribute("OddsType", SqlDbType.NVarChar , 50 , false, false, true)]
		public string OddsType
		{
			set
			{
				this._OddsType = value;
			}
			get
			{
				return this._OddsType;
			}
		}
		
		
		/// <summary>
		/// Get a Match of current UnderOverOdd object base on IdMatch
		/// </summary>
		public Match Match
		{
			get
			{
				if (this.IdMatch == null)
					return null;
	
				Match condition = new Match(this.IdMatch);
				return MatchController.FindItem(condition);
			}
		}
		
		#endregion
        
        #region Other Properties
        private static ColumnNameStruct? _ColumnName;
        public static ColumnNameStruct ColumnName
        {
            get
            {
                if (!_ColumnName.HasValue)
                    _ColumnName = new ColumnNameStruct();
                return _ColumnName.Value;
            }
        }
        #endregion

        #region NestedType
        public  struct ColumnNameStruct
        {
            /// <summary>
            /// Get the name of column [IdUnderOverOdd]
            /// </summary>
            public string IdUnderOverOdd
            {
                get
                {
                    return "IdUnderOverOdd";
                }
            }
            /// <summary>
            /// Get the name of column [IdMatch]
            /// </summary>
            public string IdMatch
            {
                get
                {
                    return "IdMatch";
                }
            }
            /// <summary>
            /// Get the name of column [Total]
            /// </summary>
            public string Total
            {
                get
                {
                    return "Total";
                }
            }
            /// <summary>
            /// Get the name of column [Under]
            /// </summary>
            public string Under
            {
                get
                {
                    return "Under";
                }
            }
            /// <summary>
            /// Get the name of column [Over]
            /// </summary>
            public string Over
            {
                get
                {
                    return "Over";
                }
            }
            /// <summary>
            /// Get the name of column [OddsType]
            /// </summary>
            public string OddsType
            {
                get
                {
                    return "OddsType";
                }
            }
        }
        #endregion
    }
}
